<?php


abstract class BaseRingtoneStatus extends BaseObject  implements Persistent {


	
	protected static $peer;


	
	protected $ringtone_id;


	
	protected $rt_approve = 0;


	
	protected $rt_approve_datetime;


	
	protected $rt_approve_admin;


	
	protected $rt_approve_description;


	
	protected $rbt_approve;


	
	protected $rbt_approve_datetime;


	
	protected $rbt_approve_admin;


	
	protected $rbt_approve_description;


	
	protected $rt_delete = 0;


	
	protected $rt_delete_datetime;


	
	protected $rt_delete_admin;


	
	protected $rt_delete_description;


	
	protected $rbt_delete = 0;


	
	protected $rbt_delete_datetime;


	
	protected $rbt_delete_admin;


	
	protected $rbt_delete_description;

	
	protected $aRingtone;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function getRingtoneId()
	{

		return $this->ringtone_id;
	}

	
	public function getRtApprove()
	{

		return $this->rt_approve;
	}

	
	public function getRtApproveDatetime($format = 'Y-m-d H:i:s')
	{

		if ($this->rt_approve_datetime === null || $this->rt_approve_datetime === '') {
			return null;
		} elseif (!is_int($this->rt_approve_datetime)) {
						$ts = strtotime($this->rt_approve_datetime);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [rt_approve_datetime] as date/time value: " . var_export($this->rt_approve_datetime, true));
			}
		} else {
			$ts = $this->rt_approve_datetime;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getRtApproveAdmin()
	{

		return $this->rt_approve_admin;
	}

	
	public function getRtApproveDescription()
	{

		return $this->rt_approve_description;
	}

	
	public function getRbtApprove()
	{

		return $this->rbt_approve;
	}

	
	public function getRbtApproveDatetime($format = 'Y-m-d H:i:s')
	{

		if ($this->rbt_approve_datetime === null || $this->rbt_approve_datetime === '') {
			return null;
		} elseif (!is_int($this->rbt_approve_datetime)) {
						$ts = strtotime($this->rbt_approve_datetime);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [rbt_approve_datetime] as date/time value: " . var_export($this->rbt_approve_datetime, true));
			}
		} else {
			$ts = $this->rbt_approve_datetime;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getRbtApproveAdmin()
	{

		return $this->rbt_approve_admin;
	}

	
	public function getRbtApproveDescription()
	{

		return $this->rbt_approve_description;
	}

	
	public function getRtDelete()
	{

		return $this->rt_delete;
	}

	
	public function getRtDeleteDatetime($format = 'Y-m-d H:i:s')
	{

		if ($this->rt_delete_datetime === null || $this->rt_delete_datetime === '') {
			return null;
		} elseif (!is_int($this->rt_delete_datetime)) {
						$ts = strtotime($this->rt_delete_datetime);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [rt_delete_datetime] as date/time value: " . var_export($this->rt_delete_datetime, true));
			}
		} else {
			$ts = $this->rt_delete_datetime;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getRtDeleteAdmin()
	{

		return $this->rt_delete_admin;
	}

	
	public function getRtDeleteDescription()
	{

		return $this->rt_delete_description;
	}

	
	public function getRbtDelete()
	{

		return $this->rbt_delete;
	}

	
	public function getRbtDeleteDatetime($format = 'Y-m-d H:i:s')
	{

		if ($this->rbt_delete_datetime === null || $this->rbt_delete_datetime === '') {
			return null;
		} elseif (!is_int($this->rbt_delete_datetime)) {
						$ts = strtotime($this->rbt_delete_datetime);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [rbt_delete_datetime] as date/time value: " . var_export($this->rbt_delete_datetime, true));
			}
		} else {
			$ts = $this->rbt_delete_datetime;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getRbtDeleteAdmin()
	{

		return $this->rbt_delete_admin;
	}

	
	public function getRbtDeleteDescription()
	{

		return $this->rbt_delete_description;
	}

	
	public function setRingtoneId($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->ringtone_id !== $v) {
			$this->ringtone_id = $v;
			$this->modifiedColumns[] = RingtoneStatusPeer::RINGTONE_ID;
		}

		if ($this->aRingtone !== null && $this->aRingtone->getId() !== $v) {
			$this->aRingtone = null;
		}

	} 
	
	public function setRtApprove($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->rt_approve !== $v || $v === 0) {
			$this->rt_approve = $v;
			$this->modifiedColumns[] = RingtoneStatusPeer::RT_APPROVE;
		}

	} 
	
	public function setRtApproveDatetime($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [rt_approve_datetime] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->rt_approve_datetime !== $ts) {
			$this->rt_approve_datetime = $ts;
			$this->modifiedColumns[] = RingtoneStatusPeer::RT_APPROVE_DATETIME;
		}

	} 
	
	public function setRtApproveAdmin($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->rt_approve_admin !== $v) {
			$this->rt_approve_admin = $v;
			$this->modifiedColumns[] = RingtoneStatusPeer::RT_APPROVE_ADMIN;
		}

	} 
	
	public function setRtApproveDescription($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->rt_approve_description !== $v) {
			$this->rt_approve_description = $v;
			$this->modifiedColumns[] = RingtoneStatusPeer::RT_APPROVE_DESCRIPTION;
		}

	} 
	
	public function setRbtApprove($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->rbt_approve !== $v) {
			$this->rbt_approve = $v;
			$this->modifiedColumns[] = RingtoneStatusPeer::RBT_APPROVE;
		}

	} 
	
	public function setRbtApproveDatetime($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [rbt_approve_datetime] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->rbt_approve_datetime !== $ts) {
			$this->rbt_approve_datetime = $ts;
			$this->modifiedColumns[] = RingtoneStatusPeer::RBT_APPROVE_DATETIME;
		}

	} 
	
	public function setRbtApproveAdmin($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->rbt_approve_admin !== $v) {
			$this->rbt_approve_admin = $v;
			$this->modifiedColumns[] = RingtoneStatusPeer::RBT_APPROVE_ADMIN;
		}

	} 
	
	public function setRbtApproveDescription($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->rbt_approve_description !== $v) {
			$this->rbt_approve_description = $v;
			$this->modifiedColumns[] = RingtoneStatusPeer::RBT_APPROVE_DESCRIPTION;
		}

	} 
	
	public function setRtDelete($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->rt_delete !== $v || $v === 0) {
			$this->rt_delete = $v;
			$this->modifiedColumns[] = RingtoneStatusPeer::RT_DELETE;
		}

	} 
	
	public function setRtDeleteDatetime($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [rt_delete_datetime] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->rt_delete_datetime !== $ts) {
			$this->rt_delete_datetime = $ts;
			$this->modifiedColumns[] = RingtoneStatusPeer::RT_DELETE_DATETIME;
		}

	} 
	
	public function setRtDeleteAdmin($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->rt_delete_admin !== $v) {
			$this->rt_delete_admin = $v;
			$this->modifiedColumns[] = RingtoneStatusPeer::RT_DELETE_ADMIN;
		}

	} 
	
	public function setRtDeleteDescription($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->rt_delete_description !== $v) {
			$this->rt_delete_description = $v;
			$this->modifiedColumns[] = RingtoneStatusPeer::RT_DELETE_DESCRIPTION;
		}

	} 
	
	public function setRbtDelete($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->rbt_delete !== $v || $v === 0) {
			$this->rbt_delete = $v;
			$this->modifiedColumns[] = RingtoneStatusPeer::RBT_DELETE;
		}

	} 
	
	public function setRbtDeleteDatetime($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [rbt_delete_datetime] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->rbt_delete_datetime !== $ts) {
			$this->rbt_delete_datetime = $ts;
			$this->modifiedColumns[] = RingtoneStatusPeer::RBT_DELETE_DATETIME;
		}

	} 
	
	public function setRbtDeleteAdmin($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->rbt_delete_admin !== $v) {
			$this->rbt_delete_admin = $v;
			$this->modifiedColumns[] = RingtoneStatusPeer::RBT_DELETE_ADMIN;
		}

	} 
	
	public function setRbtDeleteDescription($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->rbt_delete_description !== $v) {
			$this->rbt_delete_description = $v;
			$this->modifiedColumns[] = RingtoneStatusPeer::RBT_DELETE_DESCRIPTION;
		}

	} 
	
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->ringtone_id = $rs->getInt($startcol + 0);

			$this->rt_approve = $rs->getInt($startcol + 1);

			$this->rt_approve_datetime = $rs->getTimestamp($startcol + 2, null);

			$this->rt_approve_admin = $rs->getString($startcol + 3);

			$this->rt_approve_description = $rs->getString($startcol + 4);

			$this->rbt_approve = $rs->getInt($startcol + 5);

			$this->rbt_approve_datetime = $rs->getTimestamp($startcol + 6, null);

			$this->rbt_approve_admin = $rs->getString($startcol + 7);

			$this->rbt_approve_description = $rs->getString($startcol + 8);

			$this->rt_delete = $rs->getInt($startcol + 9);

			$this->rt_delete_datetime = $rs->getTimestamp($startcol + 10, null);

			$this->rt_delete_admin = $rs->getString($startcol + 11);

			$this->rt_delete_description = $rs->getString($startcol + 12);

			$this->rbt_delete = $rs->getInt($startcol + 13);

			$this->rbt_delete_datetime = $rs->getTimestamp($startcol + 14, null);

			$this->rbt_delete_admin = $rs->getString($startcol + 15);

			$this->rbt_delete_description = $rs->getString($startcol + 16);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 17; 
		} catch (Exception $e) {
			throw new PropelException("Error populating RingtoneStatus object", $e);
		}
	}

	
	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(RingtoneStatusPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			RingtoneStatusPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(RingtoneStatusPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


												
			if ($this->aRingtone !== null) {
				if ($this->aRingtone->isModified()) {
					$affectedRows += $this->aRingtone->save($con);
				}
				$this->setRingtone($this->aRingtone);
			}


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = RingtoneStatusPeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setNew(false);
				} else {
					$affectedRows += RingtoneStatusPeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


												
			if ($this->aRingtone !== null) {
				if (!$this->aRingtone->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aRingtone->getValidationFailures());
				}
			}


			if (($retval = RingtoneStatusPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}



			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = RingtoneStatusPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getRingtoneId();
				break;
			case 1:
				return $this->getRtApprove();
				break;
			case 2:
				return $this->getRtApproveDatetime();
				break;
			case 3:
				return $this->getRtApproveAdmin();
				break;
			case 4:
				return $this->getRtApproveDescription();
				break;
			case 5:
				return $this->getRbtApprove();
				break;
			case 6:
				return $this->getRbtApproveDatetime();
				break;
			case 7:
				return $this->getRbtApproveAdmin();
				break;
			case 8:
				return $this->getRbtApproveDescription();
				break;
			case 9:
				return $this->getRtDelete();
				break;
			case 10:
				return $this->getRtDeleteDatetime();
				break;
			case 11:
				return $this->getRtDeleteAdmin();
				break;
			case 12:
				return $this->getRtDeleteDescription();
				break;
			case 13:
				return $this->getRbtDelete();
				break;
			case 14:
				return $this->getRbtDeleteDatetime();
				break;
			case 15:
				return $this->getRbtDeleteAdmin();
				break;
			case 16:
				return $this->getRbtDeleteDescription();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = RingtoneStatusPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getRingtoneId(),
			$keys[1] => $this->getRtApprove(),
			$keys[2] => $this->getRtApproveDatetime(),
			$keys[3] => $this->getRtApproveAdmin(),
			$keys[4] => $this->getRtApproveDescription(),
			$keys[5] => $this->getRbtApprove(),
			$keys[6] => $this->getRbtApproveDatetime(),
			$keys[7] => $this->getRbtApproveAdmin(),
			$keys[8] => $this->getRbtApproveDescription(),
			$keys[9] => $this->getRtDelete(),
			$keys[10] => $this->getRtDeleteDatetime(),
			$keys[11] => $this->getRtDeleteAdmin(),
			$keys[12] => $this->getRtDeleteDescription(),
			$keys[13] => $this->getRbtDelete(),
			$keys[14] => $this->getRbtDeleteDatetime(),
			$keys[15] => $this->getRbtDeleteAdmin(),
			$keys[16] => $this->getRbtDeleteDescription(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = RingtoneStatusPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setRingtoneId($value);
				break;
			case 1:
				$this->setRtApprove($value);
				break;
			case 2:
				$this->setRtApproveDatetime($value);
				break;
			case 3:
				$this->setRtApproveAdmin($value);
				break;
			case 4:
				$this->setRtApproveDescription($value);
				break;
			case 5:
				$this->setRbtApprove($value);
				break;
			case 6:
				$this->setRbtApproveDatetime($value);
				break;
			case 7:
				$this->setRbtApproveAdmin($value);
				break;
			case 8:
				$this->setRbtApproveDescription($value);
				break;
			case 9:
				$this->setRtDelete($value);
				break;
			case 10:
				$this->setRtDeleteDatetime($value);
				break;
			case 11:
				$this->setRtDeleteAdmin($value);
				break;
			case 12:
				$this->setRtDeleteDescription($value);
				break;
			case 13:
				$this->setRbtDelete($value);
				break;
			case 14:
				$this->setRbtDeleteDatetime($value);
				break;
			case 15:
				$this->setRbtDeleteAdmin($value);
				break;
			case 16:
				$this->setRbtDeleteDescription($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = RingtoneStatusPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setRingtoneId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setRtApprove($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setRtApproveDatetime($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setRtApproveAdmin($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setRtApproveDescription($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setRbtApprove($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setRbtApproveDatetime($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setRbtApproveAdmin($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setRbtApproveDescription($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setRtDelete($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setRtDeleteDatetime($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setRtDeleteAdmin($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setRtDeleteDescription($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setRbtDelete($arr[$keys[13]]);
		if (array_key_exists($keys[14], $arr)) $this->setRbtDeleteDatetime($arr[$keys[14]]);
		if (array_key_exists($keys[15], $arr)) $this->setRbtDeleteAdmin($arr[$keys[15]]);
		if (array_key_exists($keys[16], $arr)) $this->setRbtDeleteDescription($arr[$keys[16]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(RingtoneStatusPeer::DATABASE_NAME);

		if ($this->isColumnModified(RingtoneStatusPeer::RINGTONE_ID)) $criteria->add(RingtoneStatusPeer::RINGTONE_ID, $this->ringtone_id);
		if ($this->isColumnModified(RingtoneStatusPeer::RT_APPROVE)) $criteria->add(RingtoneStatusPeer::RT_APPROVE, $this->rt_approve);
		if ($this->isColumnModified(RingtoneStatusPeer::RT_APPROVE_DATETIME)) $criteria->add(RingtoneStatusPeer::RT_APPROVE_DATETIME, $this->rt_approve_datetime);
		if ($this->isColumnModified(RingtoneStatusPeer::RT_APPROVE_ADMIN)) $criteria->add(RingtoneStatusPeer::RT_APPROVE_ADMIN, $this->rt_approve_admin);
		if ($this->isColumnModified(RingtoneStatusPeer::RT_APPROVE_DESCRIPTION)) $criteria->add(RingtoneStatusPeer::RT_APPROVE_DESCRIPTION, $this->rt_approve_description);
		if ($this->isColumnModified(RingtoneStatusPeer::RBT_APPROVE)) $criteria->add(RingtoneStatusPeer::RBT_APPROVE, $this->rbt_approve);
		if ($this->isColumnModified(RingtoneStatusPeer::RBT_APPROVE_DATETIME)) $criteria->add(RingtoneStatusPeer::RBT_APPROVE_DATETIME, $this->rbt_approve_datetime);
		if ($this->isColumnModified(RingtoneStatusPeer::RBT_APPROVE_ADMIN)) $criteria->add(RingtoneStatusPeer::RBT_APPROVE_ADMIN, $this->rbt_approve_admin);
		if ($this->isColumnModified(RingtoneStatusPeer::RBT_APPROVE_DESCRIPTION)) $criteria->add(RingtoneStatusPeer::RBT_APPROVE_DESCRIPTION, $this->rbt_approve_description);
		if ($this->isColumnModified(RingtoneStatusPeer::RT_DELETE)) $criteria->add(RingtoneStatusPeer::RT_DELETE, $this->rt_delete);
		if ($this->isColumnModified(RingtoneStatusPeer::RT_DELETE_DATETIME)) $criteria->add(RingtoneStatusPeer::RT_DELETE_DATETIME, $this->rt_delete_datetime);
		if ($this->isColumnModified(RingtoneStatusPeer::RT_DELETE_ADMIN)) $criteria->add(RingtoneStatusPeer::RT_DELETE_ADMIN, $this->rt_delete_admin);
		if ($this->isColumnModified(RingtoneStatusPeer::RT_DELETE_DESCRIPTION)) $criteria->add(RingtoneStatusPeer::RT_DELETE_DESCRIPTION, $this->rt_delete_description);
		if ($this->isColumnModified(RingtoneStatusPeer::RBT_DELETE)) $criteria->add(RingtoneStatusPeer::RBT_DELETE, $this->rbt_delete);
		if ($this->isColumnModified(RingtoneStatusPeer::RBT_DELETE_DATETIME)) $criteria->add(RingtoneStatusPeer::RBT_DELETE_DATETIME, $this->rbt_delete_datetime);
		if ($this->isColumnModified(RingtoneStatusPeer::RBT_DELETE_ADMIN)) $criteria->add(RingtoneStatusPeer::RBT_DELETE_ADMIN, $this->rbt_delete_admin);
		if ($this->isColumnModified(RingtoneStatusPeer::RBT_DELETE_DESCRIPTION)) $criteria->add(RingtoneStatusPeer::RBT_DELETE_DESCRIPTION, $this->rbt_delete_description);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(RingtoneStatusPeer::DATABASE_NAME);

		$criteria->add(RingtoneStatusPeer::RINGTONE_ID, $this->ringtone_id);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getRingtoneId();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setRingtoneId($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setRtApprove($this->rt_approve);

		$copyObj->setRtApproveDatetime($this->rt_approve_datetime);

		$copyObj->setRtApproveAdmin($this->rt_approve_admin);

		$copyObj->setRtApproveDescription($this->rt_approve_description);

		$copyObj->setRbtApprove($this->rbt_approve);

		$copyObj->setRbtApproveDatetime($this->rbt_approve_datetime);

		$copyObj->setRbtApproveAdmin($this->rbt_approve_admin);

		$copyObj->setRbtApproveDescription($this->rbt_approve_description);

		$copyObj->setRtDelete($this->rt_delete);

		$copyObj->setRtDeleteDatetime($this->rt_delete_datetime);

		$copyObj->setRtDeleteAdmin($this->rt_delete_admin);

		$copyObj->setRtDeleteDescription($this->rt_delete_description);

		$copyObj->setRbtDelete($this->rbt_delete);

		$copyObj->setRbtDeleteDatetime($this->rbt_delete_datetime);

		$copyObj->setRbtDeleteAdmin($this->rbt_delete_admin);

		$copyObj->setRbtDeleteDescription($this->rbt_delete_description);


		$copyObj->setNew(true);

		$copyObj->setRingtoneId(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new RingtoneStatusPeer();
		}
		return self::$peer;
	}

	
	public function setRingtone($v)
	{


		if ($v === null) {
			$this->setRingtoneId(NULL);
		} else {
			$this->setRingtoneId($v->getId());
		}


		$this->aRingtone = $v;
	}


	
	public function getRingtone($con = null)
	{
		if ($this->aRingtone === null && ($this->ringtone_id !== null)) {
						include_once 'lib/model/om/BaseRingtonePeer.php';

			$this->aRingtone = RingtonePeer::retrieveByPK($this->ringtone_id, $con);

			
		}
		return $this->aRingtone;
	}

} 